﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MIMSWeb.Infrastructure.Abstract;
using System.Web.Security;

namespace MIMSWeb.Infrastructure.Concrete
{
    public class FormsAuthProvider : IAuthProvider
    {
        #region IAuthProvider Members

        public bool Authenticate(string Username, string Password)
        {
            bool result = Membership.ValidateUser(Username, Password);

            if (result)
            {
                FormsAuthentication.SetAuthCookie(Username, false);
            }

            return result;
        }

        public void LogOff()
        {
            FormsAuthentication.SignOut();

        }

        public bool ChangePassword(string Username, string OldPassword, string NewPassword)
        {
            throw new NotImplementedException();
        }

        public string GetUserEmail(string Username)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}